package cn.topevery.garden.wapi.utils;


/**
 * 描述 状态转换工具类
 *
 * @author wenzhao.lin
 * @created 2021 -08-19 13:24:45
 */
public class StatusUtils {

    public static Integer getStatus(String name){
        Integer temp = null;
        if("停用".equals(name)){
            temp = -1;
        }
        if("待审核".equals(name)){
            temp = 0;
        }
        if("审核通过".equals(name)){
            temp = 1;
        }
        if("审核失败".equals(name)){
            temp = 2;
        }
        if("审核中".equals(name)){
            temp = 3;
        }

        return temp;
    }

    public static Boolean getIsTime(String name){
        boolean temp = false;
        if("否".equals(name)){
            temp = false;
        }
        if("是".equals(name)){
            temp = true;
        }

        return temp;
    }

    public static Integer getOpenStatus(String name){
        Integer temp = null;
        if("正常开放".equals(name)){
            temp = 0;
        }
        if("关闭".equals(name)){
            temp = 1;
        }

        return temp;
    }

    public static Integer getTreeType(String name){
        Integer temp = null;
        if("古树名木".equals(name)){
            temp = 2;
        }
        if("后备资源".equals(name)){
            temp = 1;
        }
        if("稀有植物".equals(name)){
            temp = 3;
        }

        return temp;
    }

    public static Integer getGoodsType(String name){
        Integer temp = null;
        if("采购进货".equals(name)){
            temp = 1;
        }
        if("采购退货".equals(name)){
            temp = 2;
        }

        return temp;
    }

    public static Integer getObjectType(String name){
        Integer temp = null;
        if("人员".equals(name)){
            temp = 0;
        }
        if("车辆".equals(name)){
            temp = 1;
        }

        return temp;
    }
}
